import positionController from '../controller/positionController';
import searchController from '../controller/searchController';
import personController from '../controller/personController';

export default class Router {
  constructor() {
    this.initEvent();
    new positionController().render();
  }

  initEvent() {
    window.addEventListener('hashchange', () => {
      var hash = location.hash.replace('#', '');
      switch (hash) {
        case "position":
          new positionController().render();
          break;
        case "search":
          new searchController().render();
          break;
        case "person":
          new personController().render();
          break;
      }

    })
  }

}